/*************************************************************************
 *
 *   file		: GameTables.cs
 *   copyright		: (C) The WCell Team
 *   email		: info@wcell.org
 *   last changed	: $LastChangedDate: 2008-01-31 19:35:36 +0800 (Thu, 31 Jan 2008) $
 *   last author	: $LastChangedBy: tobz $
 *   revision		: $Rev: 87 $
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *************************************************************************/

namespace WCell.RealmServer.RacesClasses
{
	/// <summary>
	/// Temporary GameTables info
	/// TODO: Find in which DBC file are XXXRatings and use it instead hardcoded stuff    
	/// </summary>
	public class GameTables
	{
		public static readonly float[] BlockRating = new[]
            {
                0.192308f, 0.192308f, 0.192308f, 0.192308f, 0.192308f, 0.192308f, 0.192308f, 0.192308f, 0.192308f,
                0.192308f, 0.288462f, 0.384615f, 0.480769f, 0.576923f, 0.673077f, 0.769231f,
                0.865385f, 0.961538f, 1.057692f, 1.153846f, 1.25f, 1.346154f, 1.442308f, 1.538462f, 1.634615f, 1.730769f
                , 1.826923f, 1.923077f, 2.019231f, 2.115385f, 2.211539f, 2.307692f,
                2.403846f, 2.5f, 2.596154f, 2.692308f, 2.788461f, 2.884615f, 2.980769f, 3.076923f, 3.173077f, 3.269231f,
                3.365385f, 3.461538f, 3.557692f, 3.653846f, 3.75f, 3.846154f,
                3.942308f, 4.038462f, 4.134615f, 4.230769f, 4.326923f, 4.423077f, 4.519231f, 4.615385f, 4.711538f,
                4.807693f, 4.903846f, 5f, 5.189874f, 5.394737f, 5.616438f, 5.857142f,
                6.119403f, 6.406251f, 6.721312f, 7.068965f, 7.454545f, 7.884615f, 7.980769f, 8.076923f, 8.173077f,
                8.269231f, 8.365384f, 8.461538f, 8.557693f, 8.653846f, 8.75f, 8.846154f,
                8.942307f, 9.038462f, 9.134615f, 9.230769f, 9.326923f, 9.423077f, 9.519231f, 9.615385f, 9.711538f,
                9.807693f, 9.903846f, 10f, 10.09615f, 10.19231f, 10.28846f, 10.38462f,
                10.48077f, 10.57692f, 10.67308f, 10.76923f
            };

		public static readonly float[] DefenseRating = new[]
            {
                0.057692f, 0.057692f, 0.057692f, 0.057692f, 0.057692f, 0.057692f, 0.057692f, 0.057692f, 0.057692f,
                0.057692f, 0.086538f, 0.115385f, 0.144231f, 0.173077f, 0.201923f, 0.230769f,
                0.259615f, 0.288462f, 0.317308f, 0.346154f, 0.375f, 0.403846f, 0.432692f, 0.461538f, 0.490385f,
                0.519231f, 0.548077f, 0.576923f, 0.605769f, 0.634615f, 0.663462f, 0.692308f,
                0.721154f, 0.75f, 0.778846f, 0.807692f, 0.836538f, 0.865385f, 0.894231f, 0.923077f, 0.951923f, 0.980769f
                , 1.009615f, 1.038462f, 1.067308f, 1.096154f, 1.125f, 1.153846f,
                1.182692f, 1.211538f, 1.240385f, 1.269231f, 1.298077f, 1.326923f, 1.355769f, 1.384615f, 1.413461f,
                1.442308f, 1.471154f, 1.5f, 1.556962f, 1.618421f, 1.684931f, 1.757143f,
                1.835821f, 1.921875f, 2.016393f, 2.12069f, 2.236364f, 2.365385f, 2.394231f, 2.423077f, 2.451923f,
                2.480769f, 2.509615f, 2.538461f, 2.567308f, 2.596154f, 2.625f, 2.653846f,
                2.682692f, 2.711538f, 2.740384f, 2.769231f, 2.798077f, 2.826923f, 2.855769f, 2.884615f, 2.913461f,
                2.942308f, 2.971154f, 3f, 3.028846f, 3.057692f, 3.086538f, 3.115384f,
                3.144231f, 3.173077f, 3.201923f, 3.230769f
            };

		public static readonly float[] DodgeRating = new[]
            {
                0.461538f, 0.461538f, 0.461538f, 0.461538f, 0.461538f, 0.461538f, 0.461538f, 0.461538f, 0.461538f,
                0.461538f, 0.692308f, 0.923077f, 1.153846f, 1.384615f, 1.615385f, 1.846154f,
                2.076923f, 2.307692f, 2.538461f, 2.769231f, 3f, 3.230769f, 3.461538f, 3.692308f, 3.923077f, 4.153846f,
                4.384615f, 4.615385f, 4.846154f, 5.076923f, 5.307693f, 5.538462f,
                5.769231f, 6f, 6.230769f, 6.461538f, 6.692307f, 6.923077f, 7.153846f, 7.384615f, 7.615385f, 7.846154f,
                8.076923f, 8.307693f, 8.538462f, 8.769231f, 9f, 9.230769f,
                9.461538f, 9.692307f, 9.923077f, 10.15385f, 10.38462f, 10.61539f, 10.84616f, 11.07692f, 11.30769f,
                11.53846f, 11.76923f, 12f, 12.4557f, 12.94737f, 13.47945f, 14.05714f,
                14.68657f, 15.375f, 16.13115f, 16.96552f, 17.89091f, 18.92308f, 19.15385f, 19.38462f, 19.61539f,
                19.84616f, 20.07692f, 20.30769f, 20.53846f, 20.76923f, 21f, 21.23077f,
                21.46154f, 21.69231f, 21.92308f, 22.15385f, 22.38462f, 22.61539f, 22.84616f, 23.07692f, 23.30769f,
                23.53846f, 23.76923f, 24f, 24.23077f, 24.46154f, 24.69231f, 24.92308f,
                25.15385f, 25.38462f, 25.61539f, 25.84616f
            };

		public static readonly float[] MeleeCritRating = new[]
            {
                0.538462f, 0.538462f, 0.538462f, 0.538462f, 0.538462f, 0.538462f, 0.538462f, 0.538462f, 0.538462f,
                0.538462f, 0.807692f, 1.076923f, 1.346154f, 1.615385f, 1.884615f, 2.153846f,
                2.423077f, 2.692308f, 2.961538f, 3.230769f, 3.5f, 3.769231f, 4.038462f, 4.307692f, 4.576923f, 4.846154f,
                5.115385f, 5.384615f, 5.653846f, 5.923077f, 6.192307f, 6.461538f,
                6.730769f, 7f, 7.269231f, 7.538462f, 7.807693f, 8.076923f, 8.346154f, 8.615384f, 8.884615f, 9.153846f,
                9.423077f, 9.692307f, 9.961538f, 10.23077f, 10.5f, 10.76923f,
                11.03846f, 11.30769f, 11.57692f, 11.84616f, 12.11539f, 12.38462f, 12.65385f, 12.92308f, 13.19231f,
                13.46154f, 13.73077f, 14f, 14.53165f, 15.10526f, 15.72603f, 16.4f,
                17.13433f, 17.9375f, 18.81967f, 19.7931f, 20.87273f, 22.07692f, 22.34616f, 22.61539f, 22.88462f,
                23.15385f, 23.42308f, 23.69231f, 23.96154f, 24.23077f, 24.5f, 24.76923f,
                25.03846f, 25.30769f, 25.57693f, 25.84616f, 26.11539f, 26.38462f, 26.65385f, 26.92308f, 27.19231f,
                27.46154f, 27.73077f, 28f, 28.26923f, 28.53846f, 28.80769f, 29.07693f,
                29.34616f, 29.61539f, 29.88462f, 30.15385f
            };

		public static readonly float[] MeleeHasteRating = MeleeHitRating;

		public static readonly float[] MeleeHitRating = new[]
            {
                0.384615f, 0.384615f, 0.384615f, 0.384615f, 0.384615f, 0.384615f, 0.384615f, 0.384615f, 0.384615f,
                0.384615f, 0.576923f, 0.769231f, 0.961538f, 1.153846f, 1.346154f, 1.538462f,
                1.730769f, 1.923077f, 2.115385f, 2.307692f, 2.5f, 2.692308f, 2.884615f, 3.076923f, 3.269231f, 3.461538f,
                3.653846f, 3.846154f, 4.038462f, 4.230769f, 4.423077f, 4.615385f,
                4.807693f, 5f, 5.192308f, 5.384615f, 5.576923f, 5.769231f, 5.961538f, 6.153846f, 6.346154f, 6.538462f,
                6.730769f, 6.923077f, 7.115385f, 7.307693f, 7.5f, 7.692307f,
                7.884615f, 8.076923f, 8.269231f, 8.461538f, 8.653846f, 8.846154f, 9.038462f, 9.230769f, 9.423077f,
                9.615385f, 9.807693f, 10f, 10.37975f, 10.78947f, 11.23288f, 11.71429f,
                12.23881f, 12.8125f, 13.44262f, 14.13793f, 14.90909f, 15.76923f, 15.96154f, 16.15385f, 16.34616f,
                16.53846f, 16.73077f, 16.92308f, 17.11539f, 17.30769f, 17.5f, 17.69231f,
                17.88462f, 18.07692f, 18.26923f, 18.46154f, 18.65385f, 18.84616f, 19.03846f, 19.23077f, 19.42308f,
                19.61539f, 19.80769f, 20f, 20.19231f, 20.38462f, 20.57692f, 20.76923f,
                20.96154f, 21.15385f, 21.34616f, 21.53846f
            };

		public static readonly float[] ParryRating = new[]
            {
                0.769231f, 0.769231f, 0.769231f, 0.769231f, 0.769231f, 0.769231f, 0.769231f, 0.769231f, 0.769231f,
                0.769231f, 1.153846f, 1.538462f, 1.923077f, 2.307692f, 2.692308f, 3.076923f,
                3.461538f, 3.846154f, 4.230769f, 4.615385f, 5f, 5.384615f, 5.769231f, 6.153846f, 6.538462f, 6.923077f,
                7.307693f, 7.692307f, 8.076923f, 8.461538f, 8.846154f, 9.230769f,
                9.615385f, 10f, 10.38462f, 10.76923f, 11.15385f, 11.53846f, 11.92308f, 12.30769f, 12.69231f, 13.07692f,
                13.46154f, 13.84616f, 14.23077f, 14.61539f, 15f, 15.38462f,
                15.76923f, 16.15385f, 16.53846f, 16.92308f, 17.30769f, 17.69231f, 18.07692f, 18.46154f, 18.84616f,
                19.23077f, 19.61539f, 20f, 20.75949f, 21.57895f, 22.46575f, 23.42857f,
                24.47761f, 25.625f, 26.88525f, 28.27586f, 29.81818f, 31.53847f, 31.92308f, 32.30769f, 32.69231f,
                33.07692f, 33.46154f, 33.84616f, 34.23077f, 34.61539f, 35f, 35.38462f,
                35.76923f, 36.15385f, 36.53846f, 36.92308f, 37.30769f, 37.69231f, 38.07693f, 38.46154f, 38.84616f,
                39.23077f, 39.61539f, 40f, 40.38462f, 40.76923f, 41.15385f, 41.53846f,
                41.92308f, 42.30769f, 42.69231f, 43.07693f
            };

		public static readonly float[] RangedCritRating = MeleeCritRating;
		public static readonly float[] RangedHasteRating = MeleeHitRating;
		public static readonly float[] RangedHitRating = MeleeHitRating;

		public static readonly float[] ResilienceRating = new[]
            {
                0.961538f, 0.961538f, 0.961538f, 0.961538f, 0.961538f, 0.961538f, 0.961538f, 0.961538f, 0.961538f,
                0.961538f, 1.442308f, 1.923077f, 2.403846f, 2.884615f, 3.365385f, 3.846154f,
                4.326923f, 4.807693f, 5.288462f, 5.769231f, 6.25f, 6.730769f, 7.211538f, 7.692307f, 8.173077f, 8.653846f
                , 9.134615f, 9.615385f, 10.09615f, 10.57692f, 11.05769f, 11.53846f,
                12.01923f, 12.5f, 12.98077f, 13.46154f, 13.94231f, 14.42308f, 14.90385f, 15.38462f, 15.86539f, 16.34616f
                , 16.82692f, 17.30769f, 17.78846f, 18.26923f, 18.75f, 19.23077f,
                19.71154f, 20.19231f, 20.67308f, 21.15385f, 21.63462f, 22.11539f, 22.59616f, 23.07692f, 23.55769f,
                24.03846f, 24.51923f, 25f, 25.94937f, 26.97369f, 28.08219f, 29.28572f,
                30.59702f, 32.03125f, 33.60656f, 35.34483f, 37.27273f, 39.42308f, 39.90385f, 40.38462f, 40.86539f,
                41.34616f, 41.82693f, 42.30769f, 42.78846f, 43.26923f, 43.75f, 44.23077f,
                44.71154f, 45.19231f, 45.67308f, 46.15385f, 46.63462f, 47.11539f, 47.59616f, 48.07693f, 48.55769f,
                49.03847f, 49.51923f, 50f, 50.48077f, 50.96154f, 51.44231f, 51.92308f,
                52.40385f, 52.88462f, 53.36539f, 53.84616f
            };

		public static readonly float[] SpellCritRating = MeleeCritRating;
		public static readonly float[] SpellHasteRating = MeleeHitRating;

		public static readonly float[] SpellHitRating = new[]
            {
                0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f,
                0.307692f, 0.461538f, 0.615385f, 0.769231f, 0.923077f, 1.076923f, 1.230769f,
                1.384615f, 1.538462f, 1.692308f, 1.846154f, 2f, 2.153846f, 2.307692f, 2.461539f, 2.615385f, 2.769231f,
                2.923077f, 3.076923f, 3.230769f, 3.384615f, 3.538462f, 3.692308f,
                3.846154f, 4f, 4.153846f, 4.307692f, 4.461538f, 4.615385f, 4.769231f, 4.923077f, 5.076923f, 5.230769f,
                5.384615f, 5.538462f, 5.692307f, 5.846154f, 6f, 6.153846f,
                6.307693f, 6.461538f, 6.615385f, 6.769231f, 6.923077f, 7.076923f, 7.230769f, 7.384615f, 7.538462f,
                7.692307f, 7.846154f, 8f, 8.303798f, 8.631579f, 8.986301f, 9.371428f,
                9.791045f, 10.25f, 10.7541f, 11.31035f, 11.92727f, 12.61539f, 12.76923f, 12.92308f, 13.07692f, 13.23077f
                , 13.38462f, 13.53846f, 13.69231f, 13.84616f, 14f, 14.15385f,
                14.30769f, 14.46154f, 14.61539f, 14.76923f, 14.92308f, 15.07692f, 15.23077f, 15.38462f, 15.53846f,
                15.69231f, 15.84616f, 16f, 16.15385f, 16.30769f, 16.46154f, 16.61539f,
                16.76923f, 16.92308f, 17.07692f, 17.23077f
            };

		public static readonly float[] Unknown2Rating = new[]
            {
                0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f, 0.307692f,
                0.307692f, 0.461538f, 0.615385f, 0.769231f, 0.923077f, 1.076923f, 1.230769f,
                1.384615f, 1.538462f, 1.692308f, 1.846154f, 2f, 2.153846f, 2.307692f, 2.461539f, 2.615385f, 2.769231f,
                2.923077f, 3.076923f, 3.230769f, 3.384615f, 3.538462f, 3.692308f,
                3.846154f, 4f, 4.153846f, 4.307692f, 4.461538f, 4.615385f, 4.769231f, 4.923077f, 5.076923f, 5.230769f,
                5.384615f, 5.538462f, 5.692307f, 5.846154f, 6f, 6.153846f,
                6.307693f, 6.461538f, 6.615385f, 6.769231f, 6.923077f, 7.076923f, 7.230769f, 7.384615f, 7.538462f,
                7.692307f, 7.846154f, 8f, 8.303798f, 8.631579f, 8.986301f, 9.371428f,
                9.791045f, 10.25f, 10.7541f, 11.31035f, 11.92727f, 12.61539f, 12.76923f, 12.92308f, 13.07692f, 13.23077f
                , 13.38462f, 13.53846f, 13.69231f, 13.84616f, 14f, 14.15385f,
                14.30769f, 14.46154f, 14.61539f, 14.76923f, 14.92308f, 15.07692f, 15.23077f, 15.38462f, 15.53846f,
                15.69231f, 15.84616f, 16f, 16.15385f, 16.30769f, 16.46154f, 16.61539f,
                16.76923f, 16.92308f, 17.07692f, 17.23077f
            };

		public static readonly float[] WeaponSkillRating = new[]
            {
                0.096154f, 0.096154f, 0.096154f, 0.096154f, 0.096154f, 0.096154f, 0.096154f, 0.096154f, 0.096154f,
                0.096154f, 0.144231f, 0.192308f, 0.240385f, 0.288462f, 0.336538f, 0.384615f,
                0.432692f, 0.480769f, 0.528846f, 0.576923f, 0.625f, 0.673077f, 0.721154f, 0.769231f, 0.817308f,
                0.865385f, 0.913462f, 0.961538f, 1.009615f, 1.057692f, 1.105769f, 1.153846f,
                1.201923f, 1.25f, 1.298077f, 1.346154f, 1.394231f, 1.442308f, 1.490385f, 1.538462f, 1.586538f, 1.634615f
                , 1.682692f, 1.730769f, 1.778846f, 1.826923f, 1.875f, 1.923077f,
                1.971154f, 2.019231f, 2.067308f, 2.115385f, 2.163461f, 2.211539f, 2.259615f, 2.307692f, 2.355769f,
                2.403846f, 2.451923f, 2.5f, 2.594937f, 2.697368f, 2.808219f, 2.928571f,
                3.059702f, 3.203125f, 3.360656f, 3.534483f, 3.727273f, 3.942308f, 3.990385f, 4.038462f, 4.086538f,
                4.134615f, 4.182692f, 4.230769f, 4.278846f, 4.326923f, 4.375f, 4.423077f,
                4.471154f, 4.519231f, 4.567307f, 4.615385f, 4.663462f, 4.711538f, 4.759615f, 4.807693f, 4.855769f,
                4.903846f, 4.951923f, 5f, 5.048077f, 5.096154f, 5.144231f, 5.192308f,
                5.240385f, 5.288462f, 5.336538f, 5.384615f
            };

		// Methods
		public static float GetValuePerRating(float[] table, int level)
		{
			if (level > 100)
			{
				level = 100;
			}
			if (level < 1)
			{
				level = 1;
			}
			return (1f / table[level - 1]);
		}
	}
}